package com.youkeyi.ddy.cloud.common.api.application.system.dictionary;

import com.youkeyi.ddy.cloud.common.api.application.system.dictionary.dto.SystemDictionaryListCloudDto;
import com.youkeyi.ddy.cloud.common.api.application.system.dictionary.param.SystemDictionaryCreateCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.system.dictionary.param.SystemDictionaryDeleteCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.system.dictionary.param.SystemDictionaryListCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.system.dictionary.param.SystemDictionaryUpdateCloudParam;
import com.youkeyi.ddy.cloud.common.response.ResponseContent;
import io.swagger.annotations.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 系统字典
 *
 * @Dictionaryor liuxiawang
 * @Date 5/24/22 10:36 PM
 * @Location shenzhen.china
 */
@Api(tags = {"【SYSTEM】dictionary management"})
@RestController
@FeignClient(value = "YOUKEYI-DDY-CLOUD-APPLICATION-SYSTEM", fallback = SystemDictionaryCloudServiceFallback.class)
@RequestMapping("/system/dictionary")
public interface SystemDictionaryCloudService {

    // 查询字典列表
    @ApiOperation(value = "Query System Dictionary List", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.dictionary.SystemDictionaryCloudService.list")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = SystemDictionaryListCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query System Dictionary List", dataType = "SystemDictionaryListCloudParam", dataTypeClass = SystemDictionaryListCloudParam.class),
    })
    @GetMapping
    public abstract SystemDictionaryListCloudDto list(SystemDictionaryListCloudParam param);

    // 创建字典
    @ApiOperation(value = "Create System Corp", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.dictionary.SystemDictionaryCloudService.create")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Create System Corp", dataType = "SystemDictionaryCreateCloudParam", dataTypeClass = SystemDictionaryCreateCloudParam.class),
    })
    @PostMapping("/create")
    public abstract ResponseContent create(@RequestBody SystemDictionaryCreateCloudParam param);


    // 编辑字典
    @ApiOperation(value = "Update System Corp", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.dictionary.SystemDictionaryCloudService.update")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Update System Corp", dataType = "SystemDictionaryUpdateCloudParam", dataTypeClass = SystemDictionaryUpdateCloudParam.class),
    })
    @PatchMapping("update")
    public abstract ResponseContent update(@RequestBody SystemDictionaryUpdateCloudParam param);


    // 删除字典
    @ApiOperation(value = "Delete System Corp", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.system.dictionary.SystemDictionaryCloudService.delete")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Delete System Corp", dataType = "SystemDictionaryDeleteCloudParam", dataTypeClass = SystemDictionaryDeleteCloudParam.class),
    })
    @DeleteMapping("/delete")
    public abstract ResponseContent delete(SystemDictionaryDeleteCloudParam param);

}
